package com.liuda.workbench.controller;

import com.liuda.workbench.service.ActivityService;
import com.liuda.workbench.service.ClueService;
import com.liuda.workbench.service.TransferService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class ChartController {
    @Autowired
    TransferService transferService;
    @Autowired
    ActivityService activityService;
    @Autowired
    ClueService clueService;
    @RequestMapping("/workbench/chart/transaction/toIndex.do")
    public String toTranIndex(){
        return "workbench/chart/transaction/index";
    }
    @RequestMapping("/workbench/chart/activity/toIndex.do")
    public String toActivityIndex(){
        return "workbench/chart/activity/index";
    }
    @RequestMapping("/workbench/chart/clue/toIndex.do")
    public String toClueIndex(){
        return "workbench/chart/clue/index";
    }
    @ResponseBody
    @RequestMapping("/workbench/chart/transaction/getStageCount.do")
    public Object getStageCount(){
        return transferService.selectStageCountByGroup();
    }
    @ResponseBody
    @RequestMapping("/workbench/chart/activity/getActivityCountByOwner.do")
    public Object getActivityCountByOwner(){
        return activityService.getActivityCountByOwner();
    }
    @ResponseBody
    @RequestMapping("/workbench/chart/clue/getClueCountByOwner.do")
    public Object getClueCountByOwner(){
        return clueService.getClueCountByOwner();
    }
}
